//
//  ICSyncManager.h
//  ICome
//
//  Created by zhangrongwu on 16/6/15.
//  Copyright © 2016年 iCom. All rights reserved.
//  同步数据管理

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, ICSyncLoadingStatus) {
    ICSyncLoadingStatusNotNetWork     = -3,   // 网络断开 或者连接不上
    ICSyncLoadingStatusConnecting     = -2,   // 开始建立连接
    ICSyncLoadingStatusConnectComplete = -1,  // 连接成功
    ICSyncLoadingStatusConnectFailure  =0,    // 连接失败
    ICSyncLoadingStatusFinish         = 1,    // 同步结束
    ICSyncLoadingStatusFailure        = 2,    // 同步失败
};

typedef void(^SyncSuccess)(id object);
typedef void(^SyncFailure)(id object);
typedef void(^ICSyncLoadingStatusBlock)(ICSyncLoadingStatus status);
typedef void(^ICSynchronousHandle)(CGFloat pro);

@interface ICSyncManager : NSObject

+ (instancetype)sharedInstance;
@property (nonatomic, assign)BOOL isSynchronizing;

@property (nonatomic, assign)ICSyncLoadingStatus syncLoadingStatus;

@property (nonatomic, assign)CGFloat syncProgress;

- (void)setSyncLoadingStatusChangeBlock:(ICSyncLoadingStatusBlock)block
                            Synchronous:(ICSynchronousHandle)handle;

// new
- (void)updateGroupListFinish:(SyncSuccess)success
                      failure:(SyncFailure)failure;
- (void)updateCmdListFinish:(SyncSuccess)success
                    failure:(SyncFailure)failure;
// receive action message
- (void)updateApplicationCommandList:(NSArray *)cmdList;

- (void)dispatch_after_shareInfo;

@end


